import request from '@/utils/request'

export default {
  /**
   * 用户列表
   * @param {*} data
   * @returns
   */
  queryPage(data) {
    return request({
      url: '/energy-carbon/ecp-admin/userExt/queryPage',
      method: 'post',
      data
    })
  },
  // 区域公司枚举
  areaCompany(data) {
    return request({
      url: '/energy-carbon/grass-core/cockpit/areaCompany',
      method: 'post',
      data
    })
  },
  /**
   * 新增
   * @param {*} data
   * @returns
   */
  add(data) {
    return request({
      url: '/energy-carbon/grass-core/user/add',
      method: 'post',
      data
    })
  },
  /**
   * 编辑更新
   * @param {*} data
   * @returns
   */
  update(data) {
    return request({
      url: '/energy-carbon/grass-core/user/update',
      method: 'post',
      data
    })
  },
  /**
   * 重置密码
   * @param {*} data
   * @returns
   */
  resetPassword(data) {
    return request({
      url: '/energy-carbon/grass-core/user/resetPassword',
      method: 'post',
      data
    })
  },
  /**
   * 详情
   * @param {*} data
   * @returns
   */
  detail(data) {
    return request({
      url: '/energy-carbon/grass-core/user/detail',
      method: 'post',
      data
    })
  },
  /**
   * 查询角色
   * @param {*} data
   * @returns
   */
  queryRole(data) {
    return request({
      url: '/energy-carbon/grass-core/user/queryRole',
      method: 'post',
      data
    })
  },
  /**
   * 提交角色
   * @param {*} data
   * @returns
   */
  allotRole(data) {
    return request({
      url: '/energy-carbon/grass-core/user/allotRole',
      method: 'post',
      data
    })
  },
  /**
   * 角色列表
   * @param {*} data
   * @returns
   */
  queryRoleList(data) {
    return request({
      url: '/energy-carbon/grass-core/role/queryRoleList',
      method: 'post',
      data
    })
  },
  /**
   * 启用禁用
   * @param {*} data
   * @returns
   */
  enableOrDisable(data) {
    return request({
      url: '/energy-carbon/grass-core/user/enableOrDisable',
      method: 'post',
      data
    })
  },
  /**
   * 删除
   * @param {*} data
   * @returns
   */
  deleteById(data) {
    return request({
      url: '/energy-carbon/grass-core/user/deleteById',
      method: 'post',
      data
    })
  },
  /**
   * 永久删除
   * @param {*} data
   * @returns
   */
  thoroughDelete(data) {
    return request({
      url: '/energy-carbon/grass-core/user/thoroughDelete',
      method: 'post',
      data
    })
  },
  /**
   * 批量删除
   * @param {*} data
   * @returns
   */
  batchDelete(data) {
    return request({
      url: '/energy-carbon/grass-core/user/batchDelete',
      method: 'post',
      data
    })
  },
  /**
   * 已删除数量
   * @param {*} data
   * @returns
   */
  countDelNum(data) {
    return request({
      url: '/energy-carbon/grass-core/user/countDelNum',
      method: 'post',
      data
    })
  },
  /**
   * 分配数据角色
   * @param {*} data
   * @returns
   */
  allotDataRangeRole(data) {
    return request({
      url: '/energy-carbon/ecp-admin/userExt/allotDataRangeRole',
      method: 'post',
      data
    })
  },
  /**
   * 退出登录
   * @param {*} data
   * @returns
   */
  loginOut() {
    return 'http://192.168.1.117/agcloud-sso/exit?redirectUrl=http://192.168.1.163:8080/home'
    // request({
    //   url: 'http://192.168.1.117/agcloud-sso/exit?redirectUrl=http://192.168.1.163:8080/home',
    //   method: 'post',
    //   data
    // })
  }
}
